package com.lzc.camera.controller;


import com.lzc.camera.common.CommonPage;
import com.lzc.camera.common.CommonResult;
import com.lzc.camera.entity.Config;
import com.lzc.camera.entity.Log;
import com.lzc.camera.entity.LogQuery;
import com.lzc.camera.service.LogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lzc
 * @since 2022-11-20 08:54:54
 */
@CrossOrigin
@RestController
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;

    //查询
    @ApiOperation(value = "查询")
    @RequestMapping("select")
    @ResponseBody
    public CommonResult selectLog(LogQuery logQuery, @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                  @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum){
        List<Log> list = logService.list(logQuery, pageSize, pageNum);
        return CommonResult.success(CommonPage.restPage(list));
    }

}
